{
	template:`
	<a-page-header title="流程实例">
		<template #extra>
			<a-button v-if="oper=='edit'&&model.issueStatus=='C'" type="primary" @click="save();">保存</a-button>
			<a-button v-if="oper=='edit'&&model.issueStatus=='C'" type="primary success" @click="issue();" :disabled="!model.oid">发布</a-button>
			<m-back @click="back(backFlag);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col :span="10">
						<a-form-item label="标识" class="index-form-item">
							{{model.identity}} v{{model.version}}
						</a-form-item>
					</a-col>
					<a-col :span="14">
						<a-form-item label="名称" class="index-form-item">
							<a-input v-model:value="model.name" placeholder="请输入名称"/>
						</a-form-item>
					</a-col>
					<a-col :span="24">
						<a-form-item label="描述" class="index-form-item">
							<a-textarea v-model:value="model.description" placeholder="请选择描述" auto-size/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="启动环节" class="index-form-item">
							<a-select v-model:value="model.startSection.oid" :options="sectionList" @focus="fillSectionList" placeholder="请选择启动环节" show-search :filter-option="selectFilter"/>
						</a-form-item>
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	<div id="flowDefine_detail" style="min-height:15px;margin-top:-15px;">
	</div>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			oper:'',
			model:{startSection:{}},
			sectionList:[],
			backFlag:false,
			detailV3:null
		};
	},
	mounted(){
		this.oper=this.param.oper;
		this.model=this.param.model;
		this.fillSectionList();
		this.initSection();
	},
	methods:{
		save:function(){
			this.requestData('action/flow/flowDefine/doSave',
				{model:this.model},
				data=>{
					if(!data.code){
						this.$message.success(data.msg);
						this.model=data.model;
						this.backFlag=true;
						this.initSection();
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		},
		issue:function(){
			this.$confirm({
				title: '发布流程',
				content: '发布后不可修改, 确定要发布流程吗?',
				onOk: function(){
					this.requestData('action/flow/flowDefine/doIssue',
						{model:this.model},
						data=>{
							if(!data.code){
								this.$message.success(data.msg);
								this.back(true);
							}else{
								this.$message.error(data.msg);
							}
						}
					);
				}.bind(this)
			});
		},
		fillSectionList:function(){
			this.requestData('action/flow/flowDefine/getAllSection',
				{oid:this.model.oid},
				data=>{
					if(!data.code){
						this.sectionList=data.sectionList;
					}else{
						this.$message.error(data.msg);
					}
				}
			);
		},
		initSection:function(){//初始化环节列表
			if(this.model.oid){
				this.loadPage("flowDefine_detail",
					"action/flow/flowSection/flowSectionList",
					{params:{"fromSection.flowDefine.oid":this.model.oid,"oper":this.oper}},
					function(pv,v3){}.bind(this)
		        );
			}
		},
	}
}